#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Predesys - Predesys Server
# Version: 0.1.0
# Author: Jose A. Jimenez <jajimc@gmail.com>
# License: GPL 3.0 (see "license" file)

import sys
import commands
import exceptions
CORE_DIR = commands.getoutput("predesys-server system corepath")
sys.path.append(CORE_DIR)
import users
import services
import addresslog

class ServiceException(exceptions.Exception):
    pass
    
def get_user_groups():
    return users.get_user_groups()
    
def is_user_group(id):
    return users.is_user_group(id)
    
def get_user_group_data(id):
    return users.get_user_group_data(id)
    
def get_users():
    return users.get_users()
    
def is_user(id):
    return users.is_user(id)
    
def get_user_data(id):
    return users.get_user_data(id)
    
def is_enabled_user(id):
    return users.is_enabled_user(id)
    
def get_address_user_pairs():
    return users.get_address_user_pairs()
    
def is_address_user_pair(address, userId):
    return users.is_address_user_pair(address, userId)
    
def get_addresses():
    return users.get_addresses()
    
def is_address(address):
    return users.is_address(address)
    
def get_address_users(address):
    return users.get_address_users(address)

def get_addresslog_results_limit():
    return addresslog.get_results_limit()
    
def get_log_addresses(limit):
    return addresslog.get_log_addresses(limit)
    
def get_log_registered_addresses(limit):
    return addresslog.get_log_registered_addresses(limit)
    
def get_last_log_modified_date():
    return addresslog.get_last_log_modified_date()
    
def get_formatted_message_list_header():
    return services.get_formatted_message_list_header()
    
def get_formatted_message(destination, body):
    return services.get_formatted_message(destination, body)
    
def get_formatted_message_list_footer():
    return services.get_formatted_message_list_footer()
    
def is_message_list(messageListString):
    return services.is_message_list(messageListString)
    
def is_message(text):
    return services.is_message(text)
